package com.baize.minespace.config;

import lombok.Data;


import java.util.Properties;

@Data
public class MailConfig {
    public static final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    //QQ邮箱服务器
    public static final String smtpHost="smtp.qq.com";
    //邮箱用户名，即QQ账号（自定义）
    public static final String username = "2281254612@qq.com";
    //邮箱授权码（自定义）
    public static final String password = "arxamczhwnhldiab";
    //要发送到的邮箱（自定义）
    public static final String to = "2250259355@qq.com";
    //自己的邮箱（自定义）
    public static final String from = "2281254612@qq.com";

    public static Properties getProperties() {
        Properties props = new Properties();
        props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
        props.setProperty("mail.smtp.socketFactory.fallback", "false");
        props.setProperty("mail.smtp.port", "465");
        props.setProperty("mail.smtp.socketFactory.port", "465");
        props.setProperty("mail.smtp.auth", "true");
        props.put("mail.smtp.host",smtpHost);
        props.put("mail.smtp.username", username);
        props.put("mail.smtp.password", password);
        return props;
    }

}
